package com.zjitc.pigspring.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zjitc.pigspring.bean.po.Collect;
import com.zjitc.pigspring.bean.po.CollectVO;
import com.zjitc.pigspring.mapper.CollectMapper;
import com.zjitc.pigspring.service.CollectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CollectServiceImpl extends ServiceImpl<CollectMapper, Collect> implements CollectService {

    @Autowired
    private CollectMapper collectMapper;
    @Override
    public List<CollectVO> getAll() {
        return collectMapper.getAll();
    }

    @Override
    public List<CollectVO> getByUser(Integer id) {
        return collectMapper.getByUser(id);
    }

    @Override
    public List<CollectVO> getListByUsername(CollectVO collect) {
        return collectMapper.getListByUsername(collect);
    }

    @Override
    public boolean deleteByGoodId(Integer id) {
        return collectMapper.deleteByGoodId(id);
    }

    @Override
    public boolean deleteByUserId(Integer id) {
        return collectMapper.deleteByUserId(id);
    }
}
